uncommented function to switch actions by name