rewrite the function of backup