bug fix null pointer exception