fix construction of data.frame