refactored auto actions
fixed locking bug