Fix rows not closing when changing page