add callbacks for editor