add lock to prevent data race

Signed-off-by: Dakota Bailey <dbailey@pivotallabs.com>