Leak and Bug fixed