moved locking logic into callback invoker