fixed bug in view generator