fixed trylock check