an alternative solution for issue #19