Fixed event constructor on phantomjs