fixed bug of inserting querying the same endpoint