Removed console.log
Added error support