fix if condition

otherwise it would find the name in any place, including the controller name