added checkword mechanism