Revised get check boxes function