moved end refreshing command to after update