fixed if condition check