digitalWite problem

The pins are connected to a relay shield. If each of the pins are switch on then off in turn it works, but not switching all on then all off