sanitizing the input and fixing the suggested tags