This needs a lock wrapped around it.