enforces route logic