Fix the position of the beforePageHeader event to avoid problems with the to top buttons