automating paste mode on and off