Fixed a bug that occurs at login