added a warning and using optpath
added a warning and using optpath