check if defined before packages