fixed a bug in the view class