fixing callback with err first