Fixed bug with multiple calls to the main function