added possibility to run action immediately using an optional flag