bug fix with file % 1024 == 0