Write one function sanitize and use it in main.py

Write one function sanitize and use it in main.py