fix error JS if data empty.