add a test
more detailed error message fixing #988