handling exception cases