fix npe in issue #13