changed load method to handle nullptr