work on purge, fix time check