Proper errorhanlding refs #9