fixed upload of metrics data

Fork has been rebased with master branch.