fix zooming to layers when there are empty layers