Fixed critical bug in es_append