adjust login query to select one row