fix trimming input data (with use new trimming function)