fix Issue #22 - null pointer error