app runs in two modes