fixed minor referencing bug
added test for failing match