fixed issue #5

Partial fix for issue #5