patch from ashton to fix lock error