added simple search and fixed pagination