fix 2 null pointer exception