Fixing connect so it only runs the server on serve