make anchor matching work also in all cases