Add var expansion for AppID on removal

Fixed a bug introduced in the previous commit