Fixed error in middleware when force option passed