fixed global vars, now they are getting passed to actions