Fixing the close error in select resultset