Added error handling to attachment reading because it somehow threw an error.

That's a pretty bad sign; look in to it later...