added queryItem function and modified for heroku con