controller function fixed