[IMP] Function used before declaration and script should be loaded in head.