adding pre remove hook