Added logging in javascript