fixed bug in mainview