bugfix in wrapped promise