fixed setting of programme_id so it checks if programme object exists first