fixed potential NullPointerException