solving a bug on the connection listener
new version