check if module is removable before removing it