Solved the bug of login taking too much time to show the alert box