switch input functionality