You should modify the escape hash before it's inverted.