Fixing the issue where phantomjs is not stopped after execution.