add check for legal move