fix bug in upsert and app test