Rectangle looking ate the wrong direction! Urgent

Hi guys,

I have created rectangles on the start points of a polygon. But I want them to follow the direction of the polygon's segments. Anyone knows how I can sort out the direction?