Fixed nil issue of update