Try to minimize locks