fix bugs in view