1) fixing directx resources getting leaked