implemented issue #6