make login more robust, it will prompt the proper error message for different type of error