fix a movement bug using a currentPiece global var