Fixing events in casper plugin