added stuff to avoid use of PORTE when not possible