Fixed bugs with deleted state