added checks for internal transfers in triggers