add a test to make sure no TypeError when empty data array