Moved update to seperat function