implemented waiting by pressing period.