bug fix
nil check for player