fixed client javascript to work on for any server ip address