modified add router func