better locking for history server