added checking if a table is available