implementation for issue #23