bug fixes in voting and search logic