Stop destroy calling teardown twice

Currently if you call destroy it throws a JavaScript error as the teardown functionality is called twice. This stops that from happening.