Fixing search form. TODO Add tests