fix rewrite path problem and init problem