correct inner join  bug
delete unnecessary  code