fix update.df function to reshape data first