fixed corner-case NullPointerException