fixed bugs in text copy