Use promise.isDone() instead of additional flag / Remove printStackTrace