fix for issue #24
fix for issue #25
fix for issue #26