overlay: moved state checking to overlay, layers are independent