A better solution for issue #5