Adding error handling.
One more commit.