fixed the where query to have a variable for each bind statements