add some tests and error messages