fix to use appropriate lock