fixed infinite loop in getMove