DF-4130 added context check and restore