add some validation, throw some errors