fixed backup writing issue