changed to has_key to avoid null pointer