fixed null pointer, closes #92