fixing same problem with tapply generator