Adding main view handler