Prevent infinite recursion when submitting jobs to the grid