find home state function