Added missing lock
Added trylock