Fix percentage calculation

Prior to this commit the percentage was not calculated correctly