Overwrite attempts leads to fatal error 500 if file exists - corrected