add mainview connection functional