Updated the calling method to upgrade the read/write lock and added a double-check to make sure that a dynamic class is not already added to the dictionary.