another fix attempt for issue #20
better solution for last commit