fixed: not thread-safe way