changed behaviour to callback with error first argument