fixes bug when player is backgrounded