fix view creation bug