fix defined detect