Fixed reconnecting issue.
Added an Action class.