fix bug in source file reading