adapted to 2.11
fixed bugs