fixed bug in router initialization