Added screenshot and fixed error when last_state is not set