Added locking. No freeing