works, but you have to run it twice. still problems due to async