fix issue where invalid url broke everything