Fixing a bug where an exception is raised - need to upstream this change