added file existance check to locate.cpp