fixed login part with new sql(subquery)