fix to cope with the MD5 check in case of safe writing