don't try to insert middleware if it's locked