Added more options to connect to db
Removed connectionerror from catch