handle None case better