create thread for main frame