updated pagination and added searching