Changed logging from console.log to $log