decreased retry count and added logging for query string