bugfix customevent support for phantomJS