fix percentage calculation