error handling and finalized dictionary