making if condition consistant as per PR #247