Added some console.log for debugging