Fix check directory packages exists