edited emdia query