made player input checking more robust