added remote host and cleaned js