fixed a bug in view class