fixed bug in query param construction