fix middleware and js incomplete features