fix function add post in class and prevent xss