You've fallen for a classic C/C++ error - using the assignment operator ( = ) when you meant the equality operator ( == ).

if( IsThere = false )

will always evaluate to the right hand side of the = operator, which in this case is false. You just need to add another =