Added error callbacks and removed useless logging