fixed from breaking changes, now using mutex instead of rwlock