added locks and dualbind