Correction for error (NullPointerException)