better switch handling, make action not blocking