ClearMainFunction