fixed bug: history.onpop()