Debuging code in javascript