changed panel logic