fix log10 logic