fixed tuple generation bug