added workaround for long async load, fixed variable with the reserved 'type' name