fixed not working if

inner if didn't work properly.
now it works properly!