UPDATED: Gems
CHANGED: Added some error handling