fix phantomjs and server ready issues