JC: fixed bug in view.