Updated mode variable to enum