created validate function, added many types