handle None cases. fixes #6. fixes #7