I got it sorted guys
The problem lay in my database schema , there was a relationship problem there.
I have a Matrix table linked to the contacts table.
The matrix holds 2 fields contactid and accountid
The contact table should have been the Parent and the Matrix the child , but i had it reversed