async thread bug