Added synchronization block to Factory