I have written the following code to copy paste some data. I would like that every time I press ctrl+s the command is executed before saving. The code works fine in a debug mode