Use 'is' rather than '==' for comparison with None