fixing an issue where when using custom templates it was drawing entire table one per table value.