Fixing broken sqlite search function