fix bug: data is undefined