caught type error in main