Fixed Memory leaks