Made tr generated in rule instead of outside it