more bug fixes in createPath