Changed exception handling while executing query so that it will return empty result set and will not stop execution of code