minor improvement to the error handling in the MainViewModel