update clear history

history clear added, if there's no connection no train undefined will be
added