added model,login and function validation