remove needless assertion
fix inappropriate locking sequenece