fix a bug: wrong initial state