fix #385 for hanging promises