fixing bug with metadata refresh