Fixes memory leak, thank you Aravind