Added checking for free space before pasting.