improve thread safety for gathering all promises
cleanup