bugfix in 3.1 branch