bugfix for casperjs