fixed handling of empty data