fixed bug where it wasn't taking page into account for the selected controller at the end