optimized mysql class, fixed login error