add libbz2 and scan dir code