Added function validation