file discrptor error fixed and test file created