avoid NullPointerException
bug fix