onOpen seams to make phantomjs go bananas og dump core, renaming and fixing som try catch to get better debug info