* plug mem leak, removed locks, fixed concurrency issues