Add router module and fix a bug that handle