fixed null pointer exception, if resource name is not available in the url/query param