Added a close() to close the previously opened file. Forgot it before like the noob I am...