use 'encoding' instead of 'middleware'