fixed bugs in view