fix a bug on view due to old code