updated layer switching