fixed regression bug from commit 4f5bbde2