small changes to ensure better copying