fix bug in atomic integer