Move unref to after if statement since on error reqh will be none