fix panic with rwlock