ready function to draw state