added expection handling to Case