[Attach-panel] Fixed to set the attachPanel after error check