bugfix: synchronization issue on compareandset