update layout reference after switching layouts