move code default setting out side the main function