fix a bug in the view class