before pagination