updated to use Plug