use time helpers, fix bug