Updates to new version of gem with better error handling