Start of the daemon has shifted couple lines bellow, because it doesn't make sense to start daemon first and check existence of PID file later.