Memory leak fixed