Working encoding on login