undefined method inject for Nil