still need to deal with the race condition..