state arg fixed in get_state_metadata, line 18