moved some stuff around in the different functions to see if this fixes the problem with loading the program via exec