fixed the chat  in a popup window js for remote use