Fixed memory leak
Fixed issue with LDP