fixed case for no data, removed unused function