added onPrepare.js file and linked it to onPrepare in conf file