fix locking issue (multiple locking is not acceptable)