changed $log.debug to error for errors