then he tore off a small square of cloth and filled it with gunpowder ; this he wiggled though the bars on the door , tying it in place next to the keyhole with his string , leaving a dangling strip of fabric to act as a wick .