Instead of adding it to Master page add it to table footer.