Not crash when user tries to change the resolution when opening by command line