Add stack trace on error
Add reconnect option