fixed loading bug with too many placeholders, improve queries