I use close instead of stop to properly destroy the context