bug fixes for darkmode and maplayers