fix stupid bug for case if path is NULL