fix crashes at login

Signed-off-by: Yaki Khadafi <elsoldollo@gmail.com>