fixed where query for authent