Added a workaround for phantomjs issue 12697