fixed some bugs with the remote connetcion