added support for es version >= 1.2