use mainPanel to render content