add atomicity