Fixed selecting correct table

Fixed selecting correct table when "excercise" tables are also present