puts middlware into next free slot