Fix multiple pages being opened on click