Removed with statement to be compatible with python versions <2.7