make workflow work with cmv and change permissions into constants