fixed wrong place for main()