improved version of fixing false conditions by Visual Studio