foget threadsafe implementation