added element lock and reduction