[fix] change state when end is called