added option to pass query string parameters