bug fix - quoted "$i" so if file name contains space the script also works