fix lock ordering