made lib dir an array and optional