fixed some bugs in the file.