Fixing phantomjs memeory problem