adding flags and daemonizing