when attaching portb to the 74hc595 - then 1 of the port pin lost power.
I'm not really sure what this means , its rather ambiguous
perhaps a schematic diagram (or a photo) of your setup would be in order