validation and more stuff