add fgets buffer size check