made navbar's isActive function more flexible