Added file blocks to close automatically