function to draw sidebar