Add encoding to controllers