Fixed write_cas

Fixed reporting about the error if data is already actual