Adding codes to handle no ndnd exception