refomat code, fixed issue #26