solution for issue #5