changed to use b64encode & b64decode