Added code for if file already exists.