updated documentation and added exception logging