fix null pointer crash for issue #133