Fixing minor error in smart select fixing function