fixed validation functions