Implementation of updateMainView