Yeah, please provide more info. I think you need to insert a delay after portb = 0.