Fixed typo fileename[0] to filename[0]