Add threads for refreshing, add toast and fix some bugs