handle case when no table returned and other exceptions