Updated application to run as a service