moved set into mutex section