apply fix for issue #1, thanks ferdau