fix period bug