Fix to prevent null exception error