fix bug where callbacks arent cleared when a layer is turned off