fix deinit sequence

Change-Id: Id51ded8e8551d8e240cec6dda015d16d9f50e991