fixed writeLocus