Added customquery param handling to DB