change the error message
add a test
Merge branch 'issue-139', fixed #139