fixed the fix function