make main panel fits inside the main container