print the right error message. - fixed #367