added logic to allow null enum