fixed a minor null pointer exception