corrected spam check logic