do you think this could cause a race condition? i move these lines before .addListener(...)