added pid file, fixed timeformat