fixed nullpointer exception: #314