Added more checks to new check path function