Added if else statement since the code was crashing when it tried to use vstack on one table