If the ref in query is empty, do not add.