use a context-manager

just to be sure...
Merge pull request #19 from hiaselhans/patch-1

use a context-manager