tried to improve function show_active_packages