Fix legend when unload