Addressed comment - moved file rewind to after block