fixed validate function possibly