added switch to run as non daemonized process