fixed login issues using to_dict()... thanks evan