this allows to avoid console spamming with 'not a function' messages after the connection to server was closed.