Promise handling modified