Solve error for append and query for random names