fixed query error in smf2