Fixed issue with hard coded file length