corrected few errors

corrected error with open file process