adding extension copying code back