modified checkbox code