Implemented PID file to prevent multiple instances