popup closes on copying the code