bug fixing and subselect manytomany