shouldn't we check we hold the lock before release?