login system with error detection completed