Added destroy function to clean element after it has been initialized