Fixed bug in callback.js and also updated logging