add an option for running in the foreground