handle 500 error.
Merge pull request #211 from forumbyr/master

handle 500 error.