Added function for cleaning editor