fixed interactions table query