changing judging condion of lock