use plug as conn middleware