replace return false statement from inside the for loop. It should be outside the while(true) loop.