Bugfix when retrieving mails