added a simple context manager for switching backends