Fixing bug in router