close() should probably be in a finally block?