Added possibility to run the script in background like a daemon