implement atomic build