updated query for unreserve resource function