replace 'set' to use cas