fix a bug of terminal anchor checking