Added player checking and error checking