added logging to debug issues with phantomjs