Wrong if condition fix