changed client js for socket interaction