Added invalid url check