moving custom load from js to py. Not working yet...