clean up of issue #653 that was failing in phantomjs