fixes bug on jump to the main function