make sure key_name not None #323