Fix when secure option is enabled

Event was called twice causing a problem with gmail server
Merge pull request #186 from asessa/patch-4

Fix when secure option is enabled