Added append(key, data) and provide direction in flipEnd callback