Fixed crashing code and adding the server url