atomic added for threads control, no perfomance gain