add refresh and fix bug with threads (asynctasks) by using some sort of mutex class object