Fixed one bug while adding sentInvitations.

little bit of code clean up.