added better validation for app