Error handling and new type