better way to get curdir