removed dead code
remove unused global
history api seems to be working fine now, fixed #386