Added options to middleware