js code working now