Change options to middleware