fixed bug when locating lib dir