Fix this horrid way of finding the proper table