fix middleware bug & load angular