fixed ldk bug

Thanks to Daniele