Fixed mutex function