added update_count to count the current step