error handling on base64 decode