fix copy to clipboard function