avoid array out of bound errors in case url has been modified manually