list lock and element lock added; thread logic fixed