changed some rs.close stuff