bug with hiding overlay in some situations