Activating and deactivating the layers