corrected error in pacman function