Memory leak fix

The following is a memory leak fix that occurs in some browsers when refreshing.

Cheers,
Jose