fix bug when context is None