Correct full-page-overlay classname
Move function call outside if-statement