using select {} to block main()