This needs a lock.