Fixed a bug with the main view