applied fix from commit 05b3a23