moved copy text function to Utils