applied commit a8baffc130c33a2cfdefa16bbd602e81f5498d08 for v0.9