Added missing lock in receive