Modified query to use Inner Join instead of Right Join