hook file read, and added clamping