changed location of function in player and added empty variable to avoid gs