Another attmpt at fixing update friction function