catch main process procedure