fix broken return value after threadsafe fix