prevent undefined in data