using inner join instead of exist