Modificated function for adding player