Fixed error due to changes in elastic api