onPlayerConnect was not doing action in the right order