added if statement for player