Make the copy paste of current directory more reliable