added correction for paste mode