switching to callback handling of the error instead of throw
todo update