Modify the process for updating layer state