added error check to dot removal and message for file write.