update funtion an GUI