some changes for phanomjs support