added checking/recording file size