correction in function controller
testing and corrections
merged