updated to include the state_dict