debug js functions