fixed bug when creating views for the first time