fixed bug when locating lib dir

redid last bugfix