add try catch in login