added the sql querry in localstore to retrieve the attachments