fixed some atomic functions