Fix null exception error.