undefined method `is_public?' for nil