fixed bug in resetting state at start of new table
implemented get_local_keywords