replaced some occurances of console.log with Debug.log