added error message. Closes #381