fixed async bug in tests