Fixed a bug for login and posting