Added input validation for the player