adding in RETURN_ON_ERROR macro that replaces the if(ret != rc::OK) { return ret; }