Adding catching to make query faster