buggy async code