Enhanced the accepted middleware