change to async pattern