fixed exception in mainviewmodel