Used ensure_packages instead of package define for better compatibility