added logic to enable and disable Base64