Also, this should probably be in a try/finally block