Fixing view appearing problem