perform validation, less flags hackery