fixed serious DWT bug