Added begin time option
Fixed bugs