implemented github issue #2