improve the copy to clipboard functionality