Fixing issue #1

With this commit i am fixing a 2.x problem where the
required .js files are not added to the header because
the hook was triggerend way to late.

Signed-off-by: Leo Unglaub <leo.unglaub@2create.at>