fixed some bugs in the remote helper