added possibility to disconnect GM tab
optimized code