removed redundant code and corrected localplayer