Fixed whenavailablepromise