fix current page detection