Include method was returning error undefined method '>' changed from res.count to res.length to resolve this error