bugfixes, and card authentication completed