adding validation check for controllers