move some JSON alert work outside of lock