Fixed the bug in catalogue searching function