Simplified the code for handling player deaths