code review fix - if condition