[FIX] bug fix in QDA

Fixes #3721

ok. Can you please add a test.