Fix PHP notice: undefined property