fixed some bugs and updating if the player isnt dead