added router middleware