James and co walked round a corner on their way up to the GCR. As they turned Sirius saw the girls out of the corner of his eye. He muttered a slug spell on the corner, just where they couldn't see it. It would turn the girls into slugs as soon as they turned the corner, and there was no way to detect it.