Implement the revisit check, however, need safe dic