fix issue causing last dependency to be removed