Added check for table name validity