changed implementation of router