fix(controllers.js): fixed save function