fix a bug due to changes of directory