cleaning before publishing