adding last_state block