Added reconnect failsafe and commands from PM