FIX apply with an empty dataframe