shortcut out of function if no data
remove for loop