Added view type check