added encore function