Added if statement around table