added bool option to retrieveOrEnroll