fixed an  if  then error