make this work on phantomjs