Adding a check in the connect.js