fix legacy stuffs