implemented issue #386