Add debugging to js