Use isset to prevent null errors