added basic function validation