Empty ResultSet exception fix